/*
 * monster.h


 *
 *  Created on: 4 avr. 2013
 *      Author: xavier
 */

#ifndef MONSTER_H_
#define MONSTER_H_

#include <stdio.h>
#include <stdlib.h>
#include "SDL.h"
#include "SDL_image.h"
#include "../include/constant.h"

/*enum m_way {
	NORTHM = 0, SOUTHM, WESTM, EASTM
};*/

typedef struct s_monster * t_monster;

extern t_monster monster_init_if_empty(t_map map,int x,int y);

extern t_monster delete_all_monster(t_game game,t_map map,t_monster monster);

extern void monster_set_validity(t_monster monster,int x);
extern int monster_get_validity(t_monster monster);

//extern int monster_get_number(int x,int y,t_monster monster);
t_monster delete_monster(t_game game,t_map map,int coorx,int coory,t_monster monster);
extern void monster_set_number(t_monster monster);

extern int monster_get_number(t_monster monster);

// Creates a new monster with one life
extern t_monster monster_init(int x,int y);
extern void monster_free(t_monster monster);


// Returns the current position of the monster
extern int monster_get_x(t_monster monster);
extern int monster_get_y(t_monster monster);

// Set the direction of the next move of the monster
extern void monster_set_current_way(t_monster monster, enum e_way way);

// Set, Increase, Decrease the number of bomb that monster can put
extern int monster_get_nb_bomb(t_monster monster);
extern void monster_inc_nb_bomb(t_monster monster);
extern void monster_dec_nb_bomb(t_monster monster);

// Load the monster position from the map
extern void monster_from_map(t_monster monster, t_map map);

// Move the monster according to the current direction
extern int monster_move(t_monster monster, t_map map);

// Display the monster on the screen
extern void monster_display(t_monster monster, SDL_Surface *screen);

extern Uint32 get_last_state(t_monster monster);

extern void set_last_state(t_monster monster);


extern t_monster new_monster(int x,int y,t_monster monster);

void cross_monster(t_game game);

extern t_monster monster_get_next(t_monster monster);

extern t_monster monster_init_list(t_monster monster);


extern void monster_move_try(t_game game);


#endif /* MONSTER_H_ */

